@extends('template.vo')
@section('content')
<ol class="breadcrumb">
  <li class="active">Profil saya</li>
</ol>

<div class="container-black" style="background-color: #fff;">
<br>
	<div class="row">
		<div class="col-lg-3">
			<div class="container-black-soft" style="background-color: #F0F0F0;">
				  <br>
		          <p align="center"><img id="profil" class="thumbnail" src="{{URL::to($gambar)}}" />
		          <a data-toggle="modal" data-target="#gantigambar"><button class="btn btn-sm btn-dark"><span class="glyphicon glyphicon-edit"></span> Ganti gambar</button></a> </p> 
		          
			</div>
		</div>
		<div class="col-lg-6">
			<div class="container-black-soft" style="background-color: #F0F0F0;">
					 <div class="row" style="margin-top:10px">
                              <div class="col-md-10 col-md-offset-1">

                                  
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Referal agen (Kode)</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text"  class="form-control" style="width:270px;height:30px"  value="{{$agen->agen_sponsor_id}}" disabled  /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kode agen</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text"  class="form-control" style="width:270px;height:30px"  value="{{$agen->agen_code}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama agen </label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text" disabled class="form-control" name="member_name" style="width:270px;height:30px" value="{{$agen->member_name}}" required  /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Alamat </label>
                                  </div>
                                  <div class="col-lg-5">
                                    <textarea disabled class="form-control" name="member_address" style="width:270px;height:70px" required  />{{$agen->member_address}}</textarea>
                                  </div>
                                  </div>
                                 
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kota / Kabupaten </label>
                                  </div>
                                  <div class="col-lg-5">
                                    <select disabled class="form-control" name="member_regional_id" style="width:270px;height:30px" required />
                                    <?php 
                                    foreach($regional as $kota){
                                      if($kota->regional_id==$agen->member_regional_id){
                                        echo '<option value="'.$kota->regional_id.'" selected>'.$kota->regional_name.'</option>';
                                      }else{
                                        echo '<option value="'.$kota->regional_id.'">'.$kota->regional_name.'</option>';
                                      }
                                    }
                                    ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Propinsi </label>
                                  </div>
                                  <div class="col-lg-5">
                                    <select disabled class="form-control" name="member_provinsi_id" style="width:270px;height:30px" required />
                                    <?php 
                                    foreach($provinsi as $kota){
                                      if($kota->provinsi_id==$agen->member_provinsi_id){
                                        echo '<option value="'.$kota->provinsi_id.'" selected>'.$kota->provinsi_name.'</option>';
                                      }else{
                                        echo '<option value="'.$kota->provinsi_id.'">'.$kota->provinsi_name.'</option>';
                                      }
                                    }
                                    ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nomor telepon / HP<font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="phone" disabled class="form-control" name="member_phone" style="width:270px;height:30px" value="{{$agen->member_phone}}" required /></input>
                                  </div>
                                  </div>

                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Alamat email<font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="email" disabled class="form-control" name="member_email" style="width:270px;height:30px" value="{{$agen->member_email}}" required /></input>
                                  </div>
                                  </div>

                                  <br>
                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Tanggal join</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text" disabled class="form-control" style="width:270px;height:30px" value='{{date("d-M-Y",strtotime($agen->member_joindate))}}' disabled /></input>
                                  </div>
                                  </div>
                                  <br>
                              </div> 
                              </div>
			</div>
		</div>
		<div class="col-lg-3">
			<div class="container-black-soft" style="background-color: #F0F0F0;">
				</br>
				<a data-toggle="modal" data-target="#dataprofil"><button class="btn btn-sm btn-dark" ><span class="glyphicon glyphicon-edit"></span> Ubah data profil</button></a> </br>
				<a data-toggle="modal" data-target="#password"><button class="btn btn-sm btn-dark" ><span class="glyphicon glyphicon-edit"></span> Ubah password</button></a> </br>
				</br>
			</div>
		</div>

	</div>

<br>
</div>



  <div class="modal fade" id="dataprofil" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:5px">Ganti data profil</label></h4>
                    </div>
                    <div align="left">
                              {{Form::open(array(
                                    'url' => '/virtualoffice/editprofile/'.$agen->agen_id,
                                    'method' => 'POST'
                                  ))}}
                              <div class="row" style="margin-top:10px">
                              <div class="col-md-10 col-md-offset-1">

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Tanggal join</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text"  class="form-control" style="width:270px;height:30px" value='{{date("d-M-Y",strtotime($agen->member_joindate))}}' disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Referal agen (Kode)</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text"  class="form-control" style="width:270px;height:30px"  value="{{$agen->agen_sponsor_id}}" disabled  /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kode agen</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text"  class="form-control" style="width:270px;height:30px"  value="{{$agen->agen_code}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nama agen <font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text"  class="form-control" name="member_name" style="width:270px;height:30px" value="{{$agen->member_name}}" required  /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Alamat <font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <textarea  class="form-control" name="member_address" style="width:270px;height:70px" required  />{{$agen->member_address}}</textarea>
                                  </div>
                                  </div>
                                 
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Kota / Kabupaten <font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <select  class="form-control" name="member_regional_id" style="width:270px;height:30px" required />
                                    <?php 
                                    foreach($regional as $kota){
                                      if($kota->regional_id==$agen->member_regional_id){
                                        echo '<option value="'.$kota->regional_id.'" selected>'.$kota->regional_name.'</option>';
                                      }else{
                                        echo '<option value="'.$kota->regional_id.'">'.$kota->regional_name.'</option>';
                                      }
                                    }
                                    ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Propinsi <font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <select  class="form-control" name="member_provinsi_id" style="width:270px;height:30px" required />
                                    <?php 
                                    foreach($provinsi as $kota){
                                      if($kota->provinsi_id==$agen->member_provinsi_id){
                                        echo '<option value="'.$kota->provinsi_id.'" selected>'.$kota->provinsi_name.'</option>';
                                      }else{
                                        echo '<option value="'.$kota->provinsi_id.'">'.$kota->provinsi_name.'</option>';
                                      }
                                    }
                                    ?>
                                    </select>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Nomor telepon / HP<font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="phone"  class="form-control" name="member_phone" style="width:270px;height:30px" value="{{$agen->member_phone}}" required /></input>
                                  </div>
                                  </div>

                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Alamat email<font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="email"  class="form-control" name="member_email" style="width:270px;height:30px" value="{{$agen->member_email}}" required /></input>
                                  </div>
                                  </div>
                                  <br>


                                  <div class="row">
                                  <div class="col-lg-5 col-lg-offset-5">
                                 <font color="red">* Data tidak boleh kosong</font><br>
                                  </div>
                                  </div>
                              </div> 
                              </div>   
                    
                    </div>
                    <div class="modal-footer">

                    <button type="submit" class="btn btn-sm btn-dark" ><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>


              <div class="modal fade" id="password" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">GAnti password</label></h4>
                    </div>
                    <div align="left">
                              {{Form::open(array(
                                    'url' => '/virtualoffice/editpassword/'.$agen->agen_id,
                                    'method' => 'POST'
                                  ))}}
                              <div class="row" style="margin-top:10px">
                              <div class="col-md-10 col-md-offset-1">

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Password baru <font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="password" placeholder="Masukan password baru" name="password" class="form-control" style="width:200px;height:30px" pattern=".{5,}" title="Minmimum 5 letters or numbers." required /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Ulangi password baru <font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="password" placeholder="Masukan password lagi" name="password_confirmation" class="form-control" style="width:200px;height:30px" pattern=".{5,}" title="Minmimum 5 letters or numbers." required  /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5 col-lg-offset-5">
                                 <font color="red">* Data tidak boleh kosong</font><br>
                                  </div>
                                  </div>

                              </div> 
                              </div>   
                    
                    </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark" ><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>



                <div class="modal fade" id="gantigambar" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>

        <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Ganti desain</label></h4>
        </div>
        <div align="left">
                  {{Form::open(array(
                        'url' => '/virtualoffice/editgambar/'.$agen->agen_id,
                        'method' => 'POST',
                        'files' => true
                      ))}}
                  <div class="row" style="margin-top:10px">
                  <div class="col-md-10 col-md-offset-1">

                      <div class="row">
                      <div class="col-lg-4">
                      <label>Gambar sebelumnya</label>
                      </div>
                      <div class="col-lg-6">
                         <img align="center" src="{{URL::to($gambar)}}" alt="Picture" style="width:250px;margin-bottom:-5px; margin-top:10px" />
                      </div>
                      </div>
                      <br>

                      <div class="row">
                      <div class="col-lg-4">
                      <label>Gambar baru</label>
                      </div>
                      <div class="col-lg-6">
                        <input type="file"  class="form-control" name="images" style="width:250px;height:30px" value="" required /></input>
                      </div>
                      </div>

                  </div> 
                  </div>   
        
        </div>
        <div class="modal-footer">

        <button type="submit" class="btn btn-sm btn-dark" ><span class="fa fa-upload"></span> Upload</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
             
        </div>
      </div>
    </div>
  </div>

@stop
@stop